/* 圣经问答游戏 - 响应式样式 */

/* 平板设备 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding: var(--spacing-lg);
    }
    
    .difficulty-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .difficulty-btn {
        flex: 1;
        min-width: 200px;
        max-width: 300px;
    }
    
    .game-controls {
        flex-direction: row;
        justify-content: center;
    }
    
    .result-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .result-actions button {
        flex: 1;
        min-width: 150px;
    }
}

/* 大屏设备 (1024px+) */
@media (min-width: 1024px) {
    .container {
        padding: var(--spacing-xl);
    }
    
    .difficulty-buttons {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .difficulty-btn {
        flex: 1;
        margin: 0 var(--spacing-sm);
    }
    
    .question-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }
    
    .game-controls {
        flex-direction: row;
        justify-content: center;
    }
    
    .result-actions {
        flex-direction: row;
        justify-content: center;
        gap: var(--spacing-lg);
    }
    
    .achievements-list {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-content {
        max-width: 500px;
    }
}

/* 小屏手机 (最大 480px) */
@media (max-width: 480px) {
    :root {
        --font-size-small: 12px;
        --font-size-normal: 16px;
        --font-size-large: 20px;
        --font-size-xl: 28px;
        --font-size-xxl: 36px;
        
        --spacing-xs: 6px;
        --spacing-sm: 12px;
        --spacing-md: 18px;
        --spacing-lg: 24px;
        --spacing-xl: 36px;
    }
    
    .container {
        padding: var(--spacing-sm);
    }
    
    .welcome-content,
    .result-content,
    .achievements-content {
        padding: var(--spacing-lg);
    }
    
    .game-title {
        font-size: var(--font-size-xl);
    }
    
    .difficulty-btn {
        padding: var(--spacing-md);
        flex-direction: column;
        text-align: center;
    }
    
    .difficulty-icon {
        margin-right: 0;
        margin-bottom: var(--spacing-xs);
    }
    
    .user-stats {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .game-header {
        padding: var(--spacing-sm);
    }
    
    .game-stats {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .question-container {
        padding: var(--spacing-lg);
    }
    
    .question-text {
        font-size: var(--font-size-normal);
    }
    
    .option-btn {
        padding: var(--spacing-md);
        font-size: var(--font-size-small);
    }
    
    .game-controls {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .result-actions {
        gap: var(--spacing-sm);
    }
    
    .modal-content {
        width: 95%;
        padding: var(--spacing-lg);
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .audio-controls {
        top: var(--spacing-xs);
        right: var(--spacing-xs);
        padding: var(--spacing-xs);
    }
    
    .volume-slider {
        width: 60px;
    }
}

/* 超小屏设备 (最大 320px) */
@media (max-width: 320px) {
    :root {
        --font-size-small: 11px;
        --font-size-normal: 14px;
        --font-size-large: 18px;
        --font-size-xl: 24px;
        --font-size-xxl: 30px;
        
        --spacing-xs: 4px;
        --spacing-sm: 8px;
        --spacing-md: 12px;
        --spacing-lg: 16px;
        --spacing-xl: 24px;
    }
    
    .container {
        padding: var(--spacing-xs);
    }
    
    .welcome-content,
    .result-content,
    .achievements-content {
        padding: var(--spacing-md);
    }
    
    .difficulty-btn {
        padding: var(--spacing-sm);
    }
    
    .question-container {
        padding: var(--spacing-md);
    }
    
    .primary-btn,
    .secondary-btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-small);
        min-height: 40px;
    }
    
    .audio-controls {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: var(--spacing-sm);
        justify-content: center;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 600px) {
    .container {
        align-items: flex-start;
        padding-top: var(--spacing-sm);
        padding-bottom: var(--spacing-sm);
    }
    
    .welcome-content,
    .result-content,
    .achievements-content {
        padding: var(--spacing-md);
    }
    
    .game-title {
        font-size: var(--font-size-xl);
        margin-bottom: var(--spacing-sm);
    }
    
    .difficulty-buttons {
        flex-direction: row;
        gap: var(--spacing-sm);
    }
    
    .difficulty-btn {
        padding: var(--spacing-sm);
    }
    
    .question-container {
        padding: var(--spacing-md);
    }
    
    .question-text {
        margin-bottom: var(--spacing-md);
    }
    
    .question-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --secondary-color: #b8860b;
        --background-color: #ffffff;
        --text-color: #000000;
        --text-light: #333333;
        --border-color: #000000;
        --shadow-color: rgba(0, 0, 0, 0.3);
    }
    
    .difficulty-btn,
    .option-btn,
    .primary-btn,
    .secondary-btn {
        border-width: 2px;
    }
    
    .option-btn:hover {
        background: #f0f0f0;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .page {
        animation: none;
    }
    
    .answer-feedback.show {
        animation: none;
    }
    
    .badge-item {
        animation: none;
    }
    
    .modal-content {
        animation: none;
    }
}

/* 打印样式 */
@media print {
    .audio-controls,
    .game-controls,
    .result-actions,
    .share-buttons {
        display: none !important;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    .page {
        page-break-inside: avoid;
    }
    
    .welcome-content,
    .result-content,
    .achievements-content {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .primary-btn,
    .secondary-btn,
    .difficulty-btn,
    .option-btn {
        min-height: 48px;
        padding: var(--spacing-md);
    }
    
    .audio-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* 移除悬停效果 */
    .difficulty-btn:hover,
    .option-btn:hover,
    .primary-btn:hover,
    .secondary-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* 添加点击反馈 */
    .difficulty-btn:active,
    .option-btn:active,
    .primary-btn:active,
    .secondary-btn:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
}

/* 大字体模式 */
.large-font {
    --font-size-small: 16px;
    --font-size-normal: 22px;
    --font-size-large: 28px;
    --font-size-xl: 36px;
    --font-size-xxl: 52px;
}

.large-font .container {
    padding: var(--spacing-lg);
}

.large-font .difficulty-btn,
.large-font .option-btn {
    padding: var(--spacing-lg);
}

.large-font .primary-btn,
.large-font .secondary-btn {
    min-height: 56px;
    padding: var(--spacing-lg) var(--spacing-xl);
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #4a90e2;
        --secondary-color: #f1c40f;
        --background-color: #2c3e50;
        --text-color: #ecf0f1;
        --text-light: #bdc3c7;
        --border-color: #34495e;
        --shadow-color: rgba(0, 0, 0, 0.3);
    }
    
    body {
        background: linear-gradient(135deg, var(--background-color) 0%, #34495e 100%);
    }
    
    .welcome-content,
    .result-content,
    .achievements-content,
    .question-container,
    .game-header,
    .answer-feedback,
    .modal-content {
        background: #34495e;
        color: var(--text-color);
    }
    
    .option-btn,
    .difficulty-btn {
        background: #2c3e50;
        color: var(--text-color);
        border-color: var(--border-color);
    }
    
    .option-btn:hover,
    .difficulty-btn:hover {
        background: #3a5169;
    }
    
    .secondary-btn {
        background: #34495e;
        color: var(--primary-color);
        border-color: var(--primary-color);
    }
    
    .user-stats,
    .result-stats {
        background: #2c3e50;
    }
}